package com.eorchis.module.trainingquestionnaire.job;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.context.ApplicationContext;

import com.eorchis.core.log4j.ILog4jManager;
import com.eorchis.module.schedule.BaseJob;
import com.eorchis.module.schedule.annotation.Job;
import com.eorchis.module.trainingquestionnaire.service.IQuestionnaireService;
import com.eorchis.module.trainingquestionnaire.ui.commond.QuestionnaireQueryCommond;

/**
 * Title: SendStartQuestionnaireMessJob<br>
 * Description: 推送问卷开始信息提醒job<br>
 * Company: GOLDGOV<br>
 * Copyright @ 2013 ORCHIS .All rights reserved.<br>
 * @author HuangTF
 * @createDate 2014-09-11
 * @version $Revision:$
 */
@Job(value="sendStartQuestionnaireMessJob")
public class SendStartQuestionnaireMessJob extends BaseJob
{
	@Override
	protected void executeJob(JobExecutionContext arg0, ApplicationContext arg1)
			throws JobExecutionException 
	{
		IQuestionnaireService questionnaireService = (IQuestionnaireService) arg1.getBean("main.java.com.eorchis.module.trainingquestionnaire.service.impl.QuestionnaireServiceImpl");
		// 记录日志
		ILog4jManager log4jManager = (ILog4jManager) arg1.getBean("com.eorchis.core.log4j.impl.Log4jManager");
		log4jManager.debugCustomLog("com.eorchis.module.trainingquestionnaire.job.SendStartQuestionnaireMessJob", "execute", "推送问卷开始提醒到门户");
		try 
		{
			questionnaireService.sendStartQuestionnaireMess(new QuestionnaireQueryCommond());
		} 
		catch (Exception e) 
		{
			e.printStackTrace();
		}
		log4jManager.debugCustomLog("com.eorchis.module.trainingquestionnaire.job.SendStartQuestionnaireMessJob", "execute", "推送问卷开始提醒到门户");
		
	}

}
